<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:cc="http://java.sun.com/jsf/composite/com">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="./resources/css/default.css" rel="stylesheet" type="text/css" />
        <link href="./resources/css/cssLayout.css" rel="stylesheet" type="text/css" />
        <link href="./resources/css/stylesheet.css" rel="stylesheet" type="text/css"/>
        <title>Deposit Page</title>
    </h:head>

    <h:body style="margin: 0 0 0 0">
        <cc:loginRedirect/>
        <cc:depositRedirect/>
        <f:metadata>
            <f:viewParam name="accountCode" value="#{accountDepositBean.accountCode}" />
        </f:metadata>
        <div id="top">
            <div class="header">
                <div class="banner"></div>
                <span class="slogan"></span>
                <div class="menu">
                    <h:form>
                        <span>Wellcome : #{loginBean.username}</span> |
                        <span><a href="../faces/home.xhtml">Home</a></span>|
                        <p:commandLink value="Logout" action="#{logoutBean.reset}" />
                    </h:form>
                </div>
            </div>
        </div>
        <div>
            <div id="left">
            </div>
            <div>
                <div id="right">
                </div>
                <div id="content" class="right_content">
                    <table align="center" style="width: 400px" >
                        <h3 align="center"> Account Deposit</h3>
                        <hr align="center" width="400px"/>
                        <h:form>
                            <p:growl id="messages" showDetail="true"/>
                            <tr>
                                <td><h:outputText value="Account Code"/></td>
                                <td><h:outputText value="#{accountDepositBean.account.acountCode}" /></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td><h:outputText value="Account Name"/></td>
                                <td><h:outputText value="#{accountDepositBean.account.accountName}" /></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td><h:outputText value="Address"/></td>
                                <td><h:outputText value="#{accountDepositBean.account.address}" /></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td><h:outputText value="Current Balance"/></td>
                                <td><h:outputText value="#{accountDepositBean.account.balance}" /> VND</td>
                                <td></td>
                            </tr>
                            <tr>
                                <td> <h:outputText value="Amount"/></td>
                                <td><h:inputText id="code" value="#{accountDepositBean.amount}" required="true"  validatorMessage="Amount must multiples of 50000 !" requiredMessage="Amount Invalid !" >
                                        <f:validateRegex pattern="[0-9]*" for="code" />
                                        <f:validateLength minimum="5"/>
                                    </h:inputText> VND</td><td></td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center"><h:commandButton styleClass="cmdBtn" value="Deposit" action="#{accountDepositBean.deposit}"/></td><td></td>
                            </tr>
                        </h:form>
                    </table>
                </div>
            </div>
        </div>
        <div id="bottom">
            <p align="center">Copy Right 2012&copy;<br/>
                Design and code by Group 2 </p>
        </div>

    </h:body>

</html>
